<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>管理留言</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript">
	function gotoPage(name){
		var str=document.getElementById(name);
		var str2=str.getAttribute("id");
		if(str2=="first"){
			var url="admin/${request.type}?pageNow=1&pageSize=${request.pageSize}";
			document.location.href=url;
		}
		else if(str2=="back")
		{
			if(${pageNow>1}){
				var url="admin/${request.type}?pageNow=${request.pageNow-1}&pageSize=${request.pageSize}";
				document.location.href=url;
			}
		}
		else if(str2=="next"){
			if(${pageNow<pageCount}){
				var url="admin/${request.type}?pageNow=${request.pageNow+1}&pageSize=${request.pageSize}";
				document.location.href=url;
			}
		}
		else if(str2="last"){
			var url="admin/${request.type}?pageNow=${request.pageCount}&pageSize=${request.pageSize}";
			document.location.href=url;
		}
	}
</script>

</head>

<body>
	<p>
		<c:if test="${!empty err}">
				${err}<br/><br/>
		</c:if>
		管理留言<br/><br/>
		<a href="admin/gotoIndex">返回主页 </a><br/><br/>
		<a href="admin/getWordNoExamine">未审核留言 </a><br/><br/>
		<a href="admin/getWordExamine">审核通过留言 </a><br/><br/>
		<a href="admin/getWordExamineNo">审核未通过留言 </a><br/><br/>
	</p>
	
	<c:forEach items="${request.list}" var="word">
		<table width="823" border="1">
		<tbody>
			<tr>
				<td width="80" align="center">留言ID</td>
				<td width="727">${word.id}</td>
			</tr>
			<tr>
				<td align="center">姓名</td>
				<td>${word.name}</td>
			</tr>
			<tr>
				<td align="center">邮箱</td>
				<td>${word.email}</td>
			</tr>
			<tr>
				<td align="center">电话</td>
				<td>${word.tel}</td>
			</tr>
			<tr>
				<td align="center">留言</td>
				<td>${word.info}</td>
			</tr>
			<tr>
				<td align="center">时间</td>
				<td><fmt:formatDate value="${word.date}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
			</tr>
			<tr>
				<td align="center">状态</td>
				<td>
					<c:if test="${word.status==0}">
						未审核
					</c:if>
					<c:if test="${word.status==1}">
						审核通过
					</c:if>
					<c:if test="${word.status==2}">
						审核未通过
					</c:if>
				</td>
			</tr>
			<tr>
				<td align="center">审核通过</td>
				<td><a href="admin/examineWord?word.id=${word.id}" onclick="return window.confirm('确认通过？')">通过</a></td>
			</tr>
			<tr>
				<td align="center">审核未通过</td>
				<td><a href="admin/noExamineWord?word.id=${word.id}" onclick="return window.confirm('确认禁止？')">禁止</a></td>
			</tr>
		</tbody>
	</table>
	<br/>
	</c:forEach>
	
	
	<div style="width:740px;margin-top: 30px;text-align: center;">
		当前页数 ${ pageNow} /总页数 ${ pageCount} 每页记录 ${ pageSize}/总记录 ${ rowsCount}<br />
		<input name="first" id="first" type="button" value="首页"
			onclick="gotoPage(this.name);" /><input id="back" name="back"
			type="button" value="上页" onclick="gotoPage(this.name)" /> <input
			id="next" name="next" type="button" value="下页"
			onclick="gotoPage(this.name)" /><input id="last" name="last"
			type="button" value="末页" onclick="gotoPage(this.name)" />
	</div>
</body>
</html>
